package net.wofly.sale.stock.service;

import java.util.List;

import net.wofly.sale.stock.domain.Warehouse;
import net.wofly.sale.stock.util.WarehouseType;

public interface IWarehouseService {

	/**
	 * 增加或修改
	 * 
	 * @param entity
	 * @return
	 */
	public Warehouse save(Warehouse entity);

	/**
	 * 删除
	 * 
	 * @param entity
	 * @return
	 */
	public void delete(Warehouse entity);

	/**
	 * 根据主键ID删除
	 * 
	 * @param key
	 * @return
	 */
	public void delete(String key);

	/**
	 * 根据主键查询
	 * 
	 * @param key
	 * @return
	 */
	public Warehouse findOne(String key);
	
	public List<Warehouse> save(List<Warehouse> entityList) ;
	
	List<Warehouse> findByWarehouseTypeAndStatus(String warehouseType ,Integer status);
	
	public String createWareHouse(String warehouseID, WarehouseType warehouseType, String warehouseName);
	
	
	/**
	 * 创建个人仓库
	 * 仓库存在直接返回，不存在创建新库后，返回仓库
	 * @param userID
	 * @param name
	 * @return
	 */
	public Warehouse createPersonalWareHouse(String userID , String name) ;
	
	/**
	 * 获取公司仓库
	 * 
	 * @return
	 */
	public Warehouse getCompanyWarehouse() ;
	
	/**
	 * 获取用户所在组织机构的仓库
	 * 
	 * @param userID
	 * 
	 * @return
	 */
	public Warehouse getOrgWarehouse(String userID) ;

}
